﻿<%@ Page Language="VB" MasterPageFile="~/Provider/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Provider_Users_Default" title="Usuarios" Theme="Granite" %>

<%@ Register Assembly="ECGControls" Namespace="ECGControls" TagPrefix="ecg" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mainCopy" Runat="Server">
<h1><asp:Label ID="lblHeader" runat="server" Text="Usuarios"></asp:Label>&nbsp;</h1>
    <p>
        <table>
            <tr>
                <td>
<asp:Label ID="lblUserNameFilter" runat="server" Text="Usuario:" AccessKey="u" AssociatedControlID="txtUserNameFilter"></asp:Label></td>
                <td>
<asp:TextBox ID="txtUserNameFilter" runat="server"></asp:TextBox></td>
                <td>
<asp:Label ID="lblEmailFilter" runat="server" Text="Email:" AccessKey="e" AssociatedControlID="txtEmailFilter"></asp:Label></td>
                <td>
<asp:TextBox ID="txtEmailFilter" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
<asp:Label ID="lblApplicationFilter" runat="server" Text="Application:" AccessKey="a" AssociatedControlID="ddlApplicationFilter"></asp:Label></td>
                <td>
<ecg:ComboList ID="ddlApplicationFilter" runat="server" DAOType="Security.Data.ApplicationDAO, Security.Data" AllowNull="True" NullValue="00000000-0000-0000-0000-000000000000">
</ecg:ComboList></td>
                <td>
<asp:Label ID="lblTenantFilter" runat="server" Text="Tenant:" AccessKey="t" AssociatedControlID="ddlTenantFilter"></asp:Label></td>
                <td>
<ecg:ComboList ID="ddlTenantFilter" runat="server" DAOType="Security.Data.TenantDAO, Security.Data" AllowNull="True" NullValue="00000000-0000-0000-0000-000000000000">
</ecg:ComboList></td>
            </tr>
            <tr>
                <td>
<asp:CheckBox ID="chkActivatedFilter" runat="server" Text="Activated:" TextAlign="Left" Checked="True" /></td>
                <td colspan="3" style="text-align: right">
<asp:LinkButton ID="btnSearch" runat="server">Buscar</asp:LinkButton></td>
            </tr>
        </table>
    </p>
<asp:GridView ID="grdUsers" runat="server" AllowPaging="True"
    AutoGenerateColumns="False" DataKeyNames="UserId" DataSourceID="dsUsers">
    <Columns>
        <asp:CommandField ShowSelectButton="True" ButtonType="Image" SelectImageUrl="~/Shared/img/edit.gif" />
        <asp:BoundField DataField="UserName" HeaderText="User" SortExpression="UserName" />
        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
        <asp:BoundField DataField="TenantName" HeaderText="Tenant" SortExpression="TenantName" />
        <asp:BoundField DataField="ApplicationName" HeaderText="Application" SortExpression="ApplicationName" />
        <asp:CheckBoxField DataField="Activated" HeaderText="Activated" SortExpression="Activated" />
    </Columns>
</asp:GridView>
<asp:ObjectDataSource ID="dsUsers" runat="server" SelectMethod="ListWithFilters"
    TypeName="Security.Data.UserViewDAO">
    <SelectParameters>
        <asp:ControlParameter ControlID="txtUserNameFilter" ConvertEmptyStringToNull="False"
            Name="username" PropertyName="Text" Type="String" />
        <asp:ControlParameter ControlID="txtEmailFilter" ConvertEmptyStringToNull="False"
            Name="email" PropertyName="Text" Type="String" />
        <asp:ControlParameter ControlID="ddlTenantFilter" ConvertEmptyStringToNull="False"
            DefaultValue="00000000-0000-0000-0000-000000000000" Name="tenantId" PropertyName="SelectedValue"
            Type="Object" />
        <asp:ControlParameter ControlID="ddlApplicationFilter" ConvertEmptyStringToNull="False"
            DefaultValue="00000000-0000-0000-0000-000000000000" Name="applicationId" PropertyName="SelectedValue"
            Type="Object" />
        <asp:ControlParameter ControlID="chkActivatedFilter" ConvertEmptyStringToNull="False"
            DefaultValue="True" Name="activated" PropertyName="Checked" Type="Boolean" />
    </SelectParameters>
</asp:ObjectDataSource>
    <br />
    <asp:Button ID="btnNewUser" runat="server" Text="Nuevo Usuario" />
</asp:Content>

